import { Application } from 'egg'

export default (app: Application) => {
  const { controller, router } = app

  router.get('/', controller.home.index)
  router.post('/api/users/createByEmail', controller.user.createUserByEmail)
  router.post('/api/users/loginByEmail', controller.user.loginByEmail)
  router.post('/api/users/genVeriCode', controller.user.sendVeriCode)
  router.post('/api/users/loginByphone', controller.user.loginByCellphone)
  router.get('/api/users/getUserInfo', app.jwt, controller.user.getUserInfo)
  router.get('/api/users/passport/gitee', controller.user.oauthToGitee)
  router.get('/api/users/passport/gitee/callback', controller.user.oauthByGitee)
}
